package com.kfm.spring.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;

@RestController
public class UploadController {

    @RequestMapping(value = "/upload", produces = "text/html;charset=utf-8")
    public String upload(MultipartFile img, String name, HttpServletRequest request) {
        System.out.println("name: " + name);

        String contentType = img.getContentType();
        System.out.println(contentType);

        System.out.println(img.getName());
        System.out.println(img.getOriginalFilename());
        System.out.println(img.getSize());

        return "上传成功";
    }
}
